/**
 * 应用配置常量
 */

// 应用基本信息
export const APP_NAME = "智能知识库对话系统";
export const APP_DESCRIPTION = "上传文件，构建知识库，与您的知识进行智能对话";

// 支持的文件类型
export const SUPPORTED_FILE_TYPES = [
  "application/pdf", // PDF
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document", // DOCX
  "text/plain", // TXT
  "text/markdown", // MD
];
export const MAX_FILE_SIZE = 50 * 1024 * 1024; // 50MB

// 分页设置
export const DEFAULT_PAGE_SIZE = 10;

// API路径
export const API_ROUTES = {
  // 知识库相关
  KNOWLEDGE_BASES: "/api/knowledge-bases",
  KNOWLEDGE_BASE: (id: string) => `/api/knowledge-bases/${id}`,
  DOCUMENTS: (knowledgeBaseId: string) => `/api/knowledge-bases/${knowledgeBaseId}/documents`,
  DOCUMENT: (knowledgeBaseId: string, id: string) => `/api/knowledge-bases/${knowledgeBaseId}/documents/${id}`,
  
  // 聊天相关
  CHATS: (knowledgeBaseId: string) => `/api/knowledge-bases/${knowledgeBaseId}/chats`,
  CHAT: (knowledgeBaseId: string, id: string) => `/api/knowledge-bases/${knowledgeBaseId}/chats/${id}`,
  MESSAGES: (chatId: string) => `/api/chats/${chatId}/messages`,
  CHAT_COMPLETION: (chatId: string) => `/api/chats/${chatId}/completion`,
  
  // 用户相关
  USER_PROFILE: "/api/user/profile",
};

// 路由路径
export const ROUTES = {
  HOME: "/",
  SIGN_IN: "/sign-in",
  SIGN_UP: "/sign-up",
  DASHBOARD: "/dashboard",
  KNOWLEDGE_BASES: "/knowledge-bases",
  KNOWLEDGE_BASE: (id: string) => `/knowledge-bases/${id}`,
  CHAT: (knowledgeBaseId: string, chatId: string) => `/chat/${knowledgeBaseId}/${chatId}`,
  SETTINGS: "/settings",
};

// 状态常量
export const StatusMessages = {
  LOADING: "加载中...",
  SUCCESS: "操作成功",
  ERROR: "操作失败",
  NOT_FOUND: "未找到资源",
  UNAUTHORIZED: "无权访问",
};

// LLM模型配置
export const DEFAULT_MODEL_SETTINGS = {
  chatModel: {
    type: "openai",
    apiUrl: "https://api.openai.com/v1/chat/completions",
    apiKey: "",
    model: "gpt-3.5-turbo",
    temperature: 0.7,
    topP: 0.9,
    maxTokens: 1000,
  },
  embeddingModel: {
    type: "openai",
    apiUrl: "https://api.openai.com/v1/embeddings",
    apiKey: "",
    model: "text-embedding-3-small",
  },
};

// 默认系统提示词
export const DEFAULT_SYSTEM_PROMPT = 
`你是一个智能知识库助手，基于用户的知识库内容提供准确的回答。
- 以友好、专业的方式提供简洁明了的回答
- 只回答与提供的知识内容相关的问题
- 如果答案不在知识库中，请诚实地说你不知道，不要编造信息
- 在回答中引用相关的来源信息`;

// 导航项
export const NAV_ITEMS = [
  { label: "知识库", href: "/knowledge-bases", icon: "database" },
  { label: "设置", href: "/settings", icon: "settings" },
];

// 主题颜色
export const COLORS = {
  primary: "#0070f3",
  secondary: "#ff4081",
  success: "#00c853",
  error: "#f44336",
  warning: "#ff9800",
  info: "#2196f3",
};

// 知识库默认颜色
export const DEFAULT_KB_COLORS = [
  "blue",
  "green",
  "purple",
  "orange",
  "pink",
  "teal",
];

// 聊天页面默认标题
export const DEFAULT_CHAT_TITLE = "新对话";

// 搜索结果最大数量
export const MAX_SEARCH_RESULTS = 5; 